package com.chentf.injection;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author chentengfei
 * @desc ...
 * @date 2021-01-31 18:51:02
 */
@Service
public class UserServiceImpl implements UserService {

    //@Autowired
    //@Qualifier("userDAOImpl")
    //@Resource(name = "userDAOImpl")
    @Resource
    private UserDAO userDAO;

    public UserDAO getUserDAO() {
        return userDAO;
    }

    //@Autowired
    // @Qualifier("userDAOImpl")
    public void setUserDAO(UserDAO userDAO) {
        System.out.println("UserServiceImpl.setUserDAO");
        this.userDAO = userDAO;
    }

    @Override
    public void register() {
        userDAO.save();
    }
}
